<?php require ROOT_PATH . 'views/layouts/header.php'; ?>

<div class="container">
    <h2>用户登录</h2>
    <?php if (isset($error)): ?>
        <p class="error"><?php echo htmlspecialchars($error, ENT_QUOTES, 'UTF-8'); ?></p>
    <?php endif; ?>
    <form action="/user/login" method="post">
        <div class="form-group">
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" required>
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required>
        </div>
        <button type="submit">登录</button>
    </form>
    <p>还没有账户？ <a href="/user/register">立即注册</a></p>
</div>

<?php require ROOT_PATH . 'views/layouts/footer.php'; ?>
